<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Make Controller Kit - Firmware API: OSC</title>
<link href="mt_doxygen.css" rel="stylesheet" type="text/css" />
<link href="../resources/mt_doxytabs.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.header {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12pt;
	color: #222222;
}
-->
</style>
</head>

<body>
<table width="800" border="0">
    <tr>
      <td colspan="3">
        <form method="get" action="http://www.google.com/search">
          <div align="right">
            <input type="text"   name="q" size="25"
              maxlength="255" value="" />
            <input type="submit" value="Search" />
            <input type="hidden" name="sitesearch" value="makingthings.com/ref/firmware/html" />
          </div>
        </form>
       </td>
    </tr>
    <tr>
      <td><div align="center"><a href="http://www.makingthings.com">
				<img src="../resources/logo_brown_medium.png" alt="MakingThings"
									width="200" height="78" border="0" align="middle" longdesc="http://www.makingthings.com" /></a></div></td>
				<td><div align="center" class="header">
      		Make Controller Kit <br />
          Firmware API
      </div></td>
      <td><div align="center"><a href="http://www.makezine.com">
					<img src="../resources/make_logo.png" alt="MAKE Zine" 
										width="164" height="73" border="0" align="middle" longdesc="http://www.makezine.com" /></a></div></td>
    </tr>
</table>
</body>
</html>
<!-- Generated by Doxygen 1.5.4 -->
<script type="text/javascript">
<!--
function changeDisplayState (e){
  var num=this.id.replace(/[^[0-9]/g,'');
  var button=this.firstChild;
  var sectionDiv=document.getElementById('dynsection'+num);
  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
    sectionDiv.style.display='block';
    button.src='open.gif';
  }else{
    sectionDiv.style.display='none';
    button.src='closed.gif';
  }
}
function initDynSections(){
  var divs=document.getElementsByTagName('div');
  var sectionCounter=1;
  for(var i=0;i<divs.length-1;i++){
    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
      var header=divs[i];
      var section=divs[i+1];
      var button=header.firstChild;
      if (button!='IMG'){
        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
        button=document.createElement('img');
        divs[i].insertBefore(button,divs[i].firstChild);
      }
      header.style.cursor='pointer';
      header.onclick=changeDisplayState;
      header.id='dynheader'+sectionCounter;
      button.src='closed.gif';
      section.id='dynsection'+sectionCounter;
      section.style.display='none';
      section.style.marginLeft='14px';
      sectionCounter++;
    }
  }
}
window.onload = initDynSections;
-->
</script>
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="classes.html"><span>Data&nbsp;Structures</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<h1>OSC</h1>Communicate with the Make Controller Kit via OSC.  
<a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Modules</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___app_l_e_d_o_s_c.html">App LED - OSC</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Control the Application Board's Status LEDs via OSC. <br></td></tr>

<p>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___digital_in_o_s_c.html">Digital In - OSC</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read the Application Board's Digital Inputs via OSC. <br></td></tr>

<p>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___digital_out_o_s_c.html">Digital Out - OSC</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Control the Application Board's Digital Outs via OSC. <br></td></tr>

<p>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___d_i_p_switch_o_s_c.html">DIP Switch - OSC</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read the Application Board's DIP Switch via OSC. <br></td></tr>

<p>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___motor_o_s_c.html">Motor - OSC</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Control DC motors with the Application Board via OSC. <br></td></tr>

<p>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_w_m_out_o_s_c.html">PWM Out - OSC</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Generate PWM signals with the Application Board via OSC. <br></td></tr>

<p>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___servo_o_s_c.html">Servo - OSC</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Control Servo motors with the Application Board via OSC. <br></td></tr>

<p>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___stepper_o_s_c.html">Stepper - OSC</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Control Stepper motors with the Application Board via OSC. <br></td></tr>

<p>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___analog_in_o_s_c.html">Analog In - OSC</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read the Application Board's Analog Inputs via OSC. <br></td></tr>

<p>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___debug_o_s_c.html">Debug - OSC</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Debug allows sending/receiving debug messages via OSC. <br></td></tr>

<p>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___io_o_s_c.html">IO - OSC</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Control any pin's direction and output from OSC. <br></td></tr>

<p>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___network_o_s_c.html">Network - OSC</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Configure the Controller Board's Network Settings via OSC. <br></td></tr>

<p>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___serial_o_s_c.html">Serial - OSC</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Configure the Serial Port and Read Characters via OSC. <br></td></tr>

<p>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___system_o_s_c.html">System - OSC</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">System controls many of the logistics of the Controller Board via OSC. <br></td></tr>

<p>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___x_bee_o_s_c.html">XBee - OSC</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Communicate with XBee modules with the Make Controller Kit via OSC. <br></td></tr>

<p>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___x_bee_config_o_s_c.html">XBee Configuration - OSC</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Configure an XBee module connected to your Make Controller Kit via OSC. <br></td></tr>

<p>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Communicate with the Make Controller Kit via OSC. 
<p>
<h2><a class="anchor" name="osc">
OSC</a></h2>
"Open Sound Control (OSC) is a protocol for communication among computers, sound synthesizers, and other multimedia devices that is optimized for modern networking technology." With OSC implemented on the Make Controller Kit, it can already talk to a wide variety of environments and devices like Java, Max/MSP, Pd, Flash, Processing, SuperCollider, and many others.<p>
OSC is based on the notion of <b>messages</b>, which are composed of an address, and the data to be sent to that address. The address looks a lot like a URL that you might type into your internet browser. Each element in the address is like a directory, with other elements inside it, and each element is separated from the next by a slash (/). Each OSC message must also start with a slash.<p>
<dl class="user" compact><dt><b>Example:</b></dt><dd>For instance, the OSC address <div class="fragment"><pre class="fragment"> /make/controller/kit 
</pre></div> says, "start in the 'make' directory, go down to the 'controller' directory, and finally to the 'kit' directory.</dd></dl>
Any number of <b>argument</b> <b>values</b> can be sent to that address by including them in the message after the address. These values can be integers (ints), floats, or strings.<p>
<dl class="user" compact><dt><b>Example:</b></dt><dd>If we wanted to send the value 35.4 to the address above, we would create the message <div class="fragment"><pre class="fragment"> /make/controller/kit 35.4 
</pre></div> with a space between the address and the data.<br>
<br>
 Additional data can be added, each separated by a space <div class="fragment"><pre class="fragment"> /make/controller/kit 35.4 lawn 12 
</pre></div></dd></dl>
<h2><a class="anchor" name="osc_mck">
OSC &amp; the Make Controller Kit</a></h2>
Many devices on the Make Controller Kit can be addressed via OSC. In sending messages to them, we need to know the OSC address, and the appropriate argument values to send.<p>
The Make Controller Kit is orgranized, for OSC, into <b>subsystems</b>. Each subsystem has one or more <b>devices</b>, and each device has one or more <b>properties</b>. To address a particular device, you'll need to create an OSC message specifying the address in that format: <div class="fragment"><pre class="fragment"> /subsystem/device/<span class="keyword">property</span> 
</pre></div> Each of the modules above provide the details for each of the subsystems on the board, along with their devices and properties. A simple example is given below.<p>
<dl class="user" compact><dt><b>Example:</b></dt><dd>To create an OSC message to turn an LED on, first identify the appropriate <b>subsystem</b>. In this case, the subsystem is called <b>appled</b>.<br>
<br>
 There are 4 LEDs, so we need to specify which one to control. The LEDs are numbered 0 -3, so choosing the first LED means the <b>device</b> value is 0.<br>
<br>
 The <b>property</b> of the LED that turns it on and off is its 'state'.<br>
<br>
 Lastly, we must specify what the state should actually be, by including an <b>argument</b> value after the address. To turn it on, this value should be 1. 0 would turn it off.<br>
 The complete OSC message looks like <div class="fragment"><pre class="fragment"> /appled/0/state 1 
</pre></div> </dd></dl>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Make Controller Kit</title>
<style type="text/css">
<!--
.footer {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 9pt;
	color: #999999;
}
-->
</style>
</head>

<body>
<hr size="1">
<div>
  <p class="footer">The Make Controller Kit is an open source project maintained by <a href="http://www.makingthings.com">MakingThings</a>.<br />
    MakingThings code is released under the <a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">Apache 2.0 license</a>.<br />
    Bug tracker, development wiki and status can be found at <a href="http://dev.makingthings.com">http://dev.makingthings.com</a>.<br />
		This document was last updated on 5 Dec 2007.
</p>
</div>
<!-- Google Analytics Code -->
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-769030-1";
urchinTracker();
</script>
</body>
</html>
